package com.haima.sage.bigdata.api.entity.api;

import java.util.List;

import javax.persistence.*;

import com.haima.sage.bigdata.api.entity.AppSystem;

@Entity
@Table(name="t_api")
public class Api {
	@Id
	private String id;
	@Column(nullable = false)
	private String name;
	@Lob
	@Column(nullable = false)
	private String data;
	private String description;
	@Convert(converter = ResultTypeConvert.class)
	private ResultType result;

	private String label;

	@ManyToMany(fetch=FetchType.EAGER)
	@JoinTable(
			name="t_api_app_system",
			joinColumns=@JoinColumn(name="api_id", referencedColumnName="id"),
			inverseJoinColumns=@JoinColumn(name="sys_id", referencedColumnName="id"))
	private List<AppSystem> systems;


	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public List<AppSystem> getSystems() {
		return systems;
	}

	public void setSystems(List<AppSystem> systems) {
		this.systems = systems;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getData() {
		return data;
	}

	public void setData(String data) {
		this.data = data;
	}

	public ResultType getResult() {
		return result;
	}

	public void setResult(ResultType result) {
		this.result = result;
	}
}
